package com.m3958.firstgwt.server.ftpserver;

import org.apache.ftpserver.filesystem.nativefs.NativeFileSystemFactory;
import org.apache.ftpserver.ftplet.FileSystemView;
import org.apache.ftpserver.ftplet.FtpException;
import org.apache.ftpserver.ftplet.User;

import com.google.inject.Inject;
import com.m3958.firstgwt.server.module.AssistedObjectFactory;



public class MyFileSystemFactory extends NativeFileSystemFactory{
	
	@Inject
	private AssistedObjectFactory aof;

    public FileSystemView createFileSystemView(User user) throws FtpException {
        synchronized (user) {
            // create home if does not exist
            FileSystemView fsView = aof.getMyFileSystemView(user, true);
            return fsView;
        }
    }
}
